package com.xbongbong.pro.cabinetfile.pojo.dto;/*/*/

import com.xbongbong.paas.domain.entity.ext.PaasAttachmentEntityExt;
import com.xbongbong.paas.toolbox.wrap.BaseDTO;
import com.xbongbong.pro.enums.CabinetFileTypeEnum;
import com.xbongbong.saas.domain.entity.CabinetFileEntity;
import com.xbongbong.saas.enums.XbbRefTypeEnum;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import javax.validation.Valid;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * 文件柜数据保存dto
 * @author 魏荣杰
 * @date 2019/6/20 16:18
 * @since v1.0
 * @version v1.0
 */
@Setter
@Getter
@ToString
public class CabinetFileSaveDTO extends BaseDTO {
    private static final long serialVersionUID = 6383271603879128104L;

    @Valid
    @NotNull(message = "{dto.msg.cabinetFileSave.cabinetFileList.NotNull}")
    private List<PaasAttachmentEntityExt> cabinetFileList;
    /**
     * 业务类型
     * @see XbbRefTypeEnum
     */
    private Integer businessType;
    /**
     * 关联数据ID
     */
    @NotNull(message = "{dto.msg.cabinetFileSave.dataId.NotNull}")
    @Min(value = 1, message = "{dto.msg.cabinetFileSave.dataId.Min}")
    private Long dataId;
    /**
     * 文件来源 0表单 1手动上传
     */
    private Integer type;

    /**
     * 引用Id，阶段任务Id
     */
    private Long refId;

    /**
     * 需要插入的列表
     */
    private List<CabinetFileEntity> insertFileList;

    public CabinetFileSaveDTO() {
        type = CabinetFileTypeEnum.UPLOAD.getType();
    }

    public CabinetFileSaveDTO(List<PaasAttachmentEntityExt> cabinetFileList, Integer businessType, Long dataId) {
        this.cabinetFileList = cabinetFileList;
        this.businessType = businessType;
        this.dataId = dataId;
    }
}
